// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 获取当前的用户 GET /api/currentUser */
export async function currentUser(options?: { [key: string]: any }) {
  return request<{ data: API.CurrentUser; }>('/api/admin/currentUser', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 退出登录接口 POST /api/login/outLogin */
export async function outLogin(options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/login/outLogin', {
    method: 'POST',
    ...(options || {}),
  });
}

/** 登录接口 POST /api/login/account */
export async function login(body: API.LoginParams) {
  return request('/api/admin/login?account='+body.username+"&pwd="+body.password, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
  });
}



export async function selectFailLoginList(code:string) {
  return request('/api/account/needlist', {
    method: 'POST',
    data: {
      merchantCode:code
    },
  });
}
export async function loLogin(agentCode:String,code:String) {
  return request('/api/order/login?agentCode='+agentCode+"&code="+code, {
    method: 'POST',
    data: {},
  });
}


export async function chenxingCode() {
  return request('/api/order/chenxing/captchakeybase', {
    method: 'POST',
    data: {},
  });
}

export async function chenxingnewCode() {
  return request('/api/order/chenxingnew/captchakeybase', {
    method: 'POST',
    data: {},
  });
}

export async function cashbroCode() {
  return request('/api/order/cashbro/getCaptchakeyBase', {
    method: 'POST',
    data: {},
  });
}

export async function cashbroLogin(agentCode:String,code:String) {
  return request('/api/order/cashbro/login?agentCode='+agentCode+'&code='+code, {
    method: 'POST',
    data: {},
  });
}

export async function prettyloanCode(merchantCode:string) {
  return request('/api/order/prettyloan/captchakey?agentCode='+merchantCode, {
    method: 'POST',
    data: {},
  });
}

export async function prettyloanLogin(agentCode:String,code:String) {
  return request('/api/order/prettyloan/login?agentCode='+agentCode+'&code='+code, {
    method: 'POST',
    data: {},
  });
}



export async function cxLogin(agentCode:string,code:string) {
  return request('/api/order/chenxing/login?agentCode='+agentCode+'&code='+code, {
    method: 'POST',
    data: {},
  });
}
export async function cxnewLogin(agentCode:string,code:string) {
  return request('/api/order/chenxingnew/login?agentCode='+agentCode+'&code='+code, {
    method: 'POST',
    data: {},
  });
}

export async function papaLogin(agentCode:string,code:string,key:string) {
  return request('/api/order/papamoney/login?agentCode='+agentCode+'&code='+code+'&key='+key, {
    method: 'POST',
    data: {},
  });
}


export async function merchantList() {
  return request('/api/account/merchant/list', {
    method: 'POST',
    data: {},
  });
}

export async function merchantUpdate(merchantCode:string) {
  return request('/api/account/merchant/update?merchantCode='+merchantCode, {
    method: 'POST',
    data: {},
  });
}

export async function uploadAccount(formData:FormData) {
  return request('/api/account/upload', {
    method: 'POST',
    data: formData,

    processData: false,
  });
}

export async function dosLogin(agentCode:String,code:String) {
  return request('/api/order/dos/login?agentCode='+agentCode+'&code='+code, {
    method: 'POST',
    data: {},
  });
}

export async function tigerLogin(agentCode:String,code:String) {
  return request('/api/order/tiger/login?agentCode='+agentCode+'&code='+code, {
    method: 'POST',
    data: {},
  });
}
export async function okrupeeLogin(agentCode:String,code:String) {
  return request('/api/order/okrupee/login?agentCode='+agentCode+'&cookie='+code, {
    method: 'POST',
    data: {},
  });
}


export async function unPushedList(merchantCode:string) {
  return request('/api/order/unpushed/list', {
    method: 'POST',
    data: {
      merchantCode:merchantCode
    },
  });
}

export async function dataPush() {
  return request('/api/order/push', {
    method: 'POST',
    data: {},
  });
}



export async function anomalyCount() {
  return request('/api/order/anomaly/count', {
    method: 'POST',
    data: {},
  });
}

export async function anomalyUpdate() {
  return request('/api/order/anomaly/update', {
    method: 'POST',
    data: {},
  });
}

export async function addAgentAccount(body: API.AddAccountBean) {
  return request('/api/account/account/add', {
    method: 'POST',
    data: body,
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

export async function reductionAgentAccount(body: API.AddAccountBean) {
  return request('/api/account/account/reduction', {
    method: 'POST',
    data: body,
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

export async function queryAgentList(merchantCode:string) {
  return request('/api/account/agent/query?merchantCode='+merchantCode, {
    method: 'POST',
  });
}

export async function rewardList(code:string,bucket:string) {
  return request('/api/mc/reward', {
    method: 'POST',
    data: {
      clientCode:code,
      bucket:bucket,
    },
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

export async function bucketList() {
  return request('/api/mc/reward/bucket', {
    method: 'POST',
    data: {},
  });
}


export async function updateReward(code:string,bucket:string,targetFinishValue:string,target:string) {
  return request('/api/mc/reward/update', {
    method: 'POST',
    data: {
      clientCode:code,
      bucket:bucket,
      targetFinishValue:targetFinishValue,
      target:target,
    },
    headers: {
      'Content-Type': 'application/json',
    },
  });
}


export async function queryAgentByOrderNo(merchantCode:string,date:string,orderNo:string,mobile:string) {
  return request('/api/agent/query?merchantCode='+merchantCode+"&date="+date+"&orderNo="+orderNo+"&mobile="+mobile, {
    method: 'POST',
  });
}
export async function queryAgentByWhatsApp(date:string,whatsapp:string) {
  return request('/api/agent/query/whatsapp?date='+date+"&whatsApp="+whatsapp, {
    method: 'POST',
  });
}



export async function insetReward(value:API.AddRewardBean) {
  return request('/api/mc/reward/insert', {
    method: 'POST',
    data: value,
    headers: {
      'Content-Type': 'application/json',
    },
  });
}


export async function orderDelete() {
  return request('/api/order/order/delete', {
    method: 'POST',
    data: {},
  });
}

export async function loExtentData() {
  return request('/api/account/account/extent?merchantCode=littleorange', {
    method: 'POST',
    data: {},
  });
}